#pragma once
#ifdef XOLIBCPP_EXPORTS
#define XOLIBCPP_API __declspec(dllexport)
#else
#define XOLIBCPP_API __declspec(dllimport)
#endif
/* Copyright(c) 1998-2012, Arnaud Colin
 * All rights reserved.
 *
 * Licence GNU GPL version 3
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   -> Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   -> Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 */

class XOLIBCPP_API CVersion
{
private:
	int _data[4];
	int major;
    int minor;
    int build;
    int revision;

	 int m_nLength; 

public:
	   __declspec ( property ( put = SetMajor, get = GetMajor ) ) 
                int Major ;
        void SetMajor (int nInputData )
        { 
                if ( nInputData < 0 ) 
                        major = 0 ; 
                else 
                        major = nInputData ; 
        }

        int GetMajor( ) const
        { 
                return major ; 
        } 

	 __declspec ( property ( put = SetMinor, get = GetMinor ) ) 
                int Minor ;
        void SetMinor (int nInputData )
        { 
                if ( nInputData < 0 ) 
                        minor = 0 ; 
                else 
                        minor = nInputData ; 
        }

        int GetMinor( ) const
        { 
                return minor ; 
        } 

	__declspec ( property ( put = SetBuild, get = GetBuild ) ) 
                int Build ;
        void SetBuild (int nInputData )
        { 
                if ( nInputData < 0 ) 
                        build = 0 ; 
                else 
                        build = nInputData ; 
        }

        int GetBuild( ) const
        { 
                return build ; 
        } 

 __declspec ( property ( put = SetRevision, get = GetRevision ) ) 
                int Revision ;
        void SetRevision (int nInputData )
        { 
                if ( nInputData < 0 ) 
                        revision = 0 ; 
                else 
                        revision = nInputData ; 
        }

        int GetRevision( ) const
        { 
                return revision ; 
        } 


/*
	 CVersion(LPWSTR version );
	 int CompareTo( LPWSTR version);
	 CVersion &operator=(LPWSTR version);
	 */
		

     CVersion(void);
	 CVersion(TCHAR Ver[] );
     CVersion(int major, int minor);
     CVersion(int major, int minor, int build);
     CVersion(int major, int minor, int build, int revision);

	 int CompareTo(const CVersion &);
        

	bool operator<(const CVersion &);
    bool operator>(const CVersion &);
    bool operator<=(const CVersion &);
    bool operator>=(const CVersion &);

	bool operator>=(TCHAR Ver[]);


	bool operator==(const CVersion &);
	CVersion &operator=(const CVersion &);

	~CVersion(void);
};

